package com.lm.activiti.boot.cases;

import com.google.common.collect.*;
import com.lm.activiti.boot.cases.dto.ParentProperties;
import org.junit.Test;

import java.util.Comparator;
import java.util.Map;

/**
 * @author lm_jcf
 * @date 2020/4/26 9:32
 */
public class ComparableTest {

    @Test
    public void compareTo(){
        ParentProperties p_1 = new ParentProperties();
        p_1.setAge(21);
        ParentProperties p_2 = new ParentProperties();
        p_2.setAge(22);

        TreeMultimap<Integer, ParentProperties> treeMultimap = TreeMultimap.create();
//        treeMultimap.put(p_2.getAge(), p_2);
//        treeMultimap.put(p_1.getAge(), p_1);
        treeMultimap.put(222225, p_1);
        treeMultimap.put(12, p_2);

        HashMultimap hashMultimap = HashMultimap.create();
        hashMultimap.put(222225, p_2);
        hashMultimap.put(12, p_1);

        System.out.println(treeMultimap);
        System.out.println(hashMultimap);


        Map<Integer, String> hashMap = Maps.newHashMap();
        hashMap.put(250, "25");
        hashMap.put(253, "25");
        hashMap.put(251, "25");
        hashMap.put(254, "25");
        hashMap.put(250355, "25");
        hashMap.put(250, "25");
        hashMap.put(21, "21");
        System.out.println(hashMap);
    }
}
